/**
 * Copyright (c) 2018-present, Chen Guodong
 * All rights reserved.
 *
 * @flow
 */


<template>
  <div class="legend">
    <div class="title">图例</div>
    <ul>
      <li><span class="rect" :style="{background: bgColor.IN_PLAN}"></span><div class="text">计划中</div></li>
      <li><span class="rect" :style="{background: bgColor.IN_PROGRESS}"></span><div class="text">实施中</div></li>
      <li><span class="rect" :style="{background: bgColor.COMPLETED}"></span><div class="text">已完成</div></li>
      <li style="clear: both"></li>
    </ul>
  </div>
</template>

<script>
import config from "../utils/config.js";
export default {
  data() {
    return {
      bgColor: config.statusColor
    };
  },
  components: {}
};
</script>

<style lang='less' scoped>
@import "../utils/theme.less";
.legend {
  position: absolute;
  right: 10px;
  bottom: 20px;
  z-index: 11;
  border: 1px solid @primary;
  border-radius: 5px;
  padding: 5px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.8);
  .title {
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    padding: 5px 0;
    box-sizing: border-box;
  }
  ul {
    li {
      clear:both;
      margin-bottom: 5px;
      .rect {
        display: inline-block;
        width: 34px;
        height: 25px;
        vertical-align: middle;
        margin-right: 6px;
      }
      .text{
        display: inline-block;
        line-height: 25px;
        height: 100%;
        // float: left;
      }
    }
  }
}
</style>
